package com.fengling.mapper;

import com.fengling.pojo.Emp;
import org.apache.ibatis.annotations.Delete;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Select;

import java.time.LocalDate;
import java.util.List;

@Mapper

public interface EmpMapper {
    @Select("select count(*) from emp ")
    public long allDate();

   /* @Select("select * from emp limit #{start},#{pageSize}")*/
    /*@Select("select *from emp limit #{start},#{pageSize} ")
    public List<Emp> showSelect(Integer start, Integer pageSize);*/

    public List<Emp> showSelect(Integer start,Integer pageSize,String name,
                                Short gender,LocalDate begin,LocalDate end);

    public Long count(String name, Short gender,LocalDate begin,LocalDate end);
    public void deleteByIds(List<Integer> ids);
    public void insert(Emp emp);
    @Select("select * from emp where id=#{id}")
    public Emp selectById(Integer id);

    public void update(Emp emp);
    @Select("select * from emp where username=#{username} and password=#{password}")
    public Emp login(Emp emp);
    @Delete("delete from emp where dept_id=#{id}")
    void deleteById(Integer id);


}
